package BasicKnowledge.Basic;

/***
 * 使用super调用父类的成员和方法
 */
class Employee{
    private String id;
    private String name;


    public Employee(String id, String name) {
        this.id = id;
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getId() {
        return id;
    }

    public void print(){
        System.out.println("该员工的工号是："+this.id);
        System.out.println("该员工的姓名为："+this.name);
    }
}
class PartTimeEmployee extends Employee{
    private double hourlyPay;
    public PartTimeEmployee(String id, String name,double hourlyPay,String test) {
        super(id, name);
        this.hourlyPay=hourlyPay;
    }

    public double getHourlyPay() {
        return hourlyPay;
    }

    public void setHourlyPay(double hourlyPay) {
        this.hourlyPay = hourlyPay;
    }
    public void print(){
        super.print();
        System.out.println("该员工的工时薪水为："+hourlyPay);
    }
}
public class SuperDemo {
    public static void main(String[] args) {
        Employee employee=new PartTimeEmployee("1001","zhangsan",200,"0");
        employee.print();
    }
}
